home *** CD-ROM | disk | FTP | other *** search
/ Sun Solutions 1997 April to September / Sun Solutions CD - APR '97 - SEP '97 (704-3778-12 Rev. H)(Sun Microsystems, Inc.)(1997).iso / products / .wais / wais_SunSolutions / UPDATE_INDEX.org < prev    next >
Text File  |  1995-11-15  |  3KB  |  77 lines

  1. #!/bin/sh
  2. #
  3. # little script to index the file tree.  We are using find instead of the
  4. # recursive option to waisindex because the waisindex option doesn't work
  5. # well.
  6. #
  7. # HEY! - this script runs IN the wais data directory
  8.  
  9. ########################################################################
  10. # variables:
  11. #
  12. # INDEX_NAME - the name of the index database.  it should match the name
  13. #              in the /cgi-bin/newwais.pl file ($src).
  14. # HTTP_SERVER - server hostname
  15. # DOCROOT     - root directory that httpd is serving out of.
  16. # DIRECTORIES - list of all the directories to index
  17. #
  18. #
  19. # NOTE: just changing the variable is not enough.  you must change all the
  20. #       pathnames in the file to your installation specifics.
  21.  
  22. INDEX_NAME=$CD_MOUNT/opt/WWW/NCSA/httpd/cgi-bin/wais-sources/catalyst_catalog
  23. HTTP_SERVER=localhost:7999
  24. DOCROOT="$CD_MOUNT/var/opt/WWW/NCSA/htdocs/CCx86-sparc"
  25.  
  26. DIRECTORIES=" \
  27. Arch_Eng Elec_Pub Mech_Eng Soft_Eng Artif_Intell Fin_Serv Medical Storage_Dev Business Geo_Inf_Sys Multimedia Sys_Admin Client_Serv Graphics_Imaging  Networking Sys_Int Consult_Pub Hard_Periph Oil_Gas Telecomm Desktop Horiz_Tools Public_Safety Transportation Doc_Image_Man Info_Man Research Utilities Ed_Comp_Train Legal Retail_Dist Elec_Design_Auto Manufacturing Signal_Proc \
  28. "
  29.  
  30. ########################################################################
  31. # get rid of the temporary index file.  if a synonym file does not exist
  32. # create a dummy one.
  33. #
  34. # Shouldn't need to worry about this section
  35. #
  36.  
  37. rm -f $INDEX_NAME.*idxable
  38.  
  39. if [ ! -f $INDEX_NAME.syn ]
  40. then
  41.     echo "# synonym file.  form is:" > $INDEX_NAME.syn
  42.     echo "# word syn0 syn1 ..." >> $INDEX_NAME.syn
  43.     echo "# e.g." >> $INDEX_NAME.syn
  44.     echo "# spam pork-shoulder yummy" >> $INDEX_NAME.syn
  45.     echo "dummy dummy" >> $INDEX_NAME.syn
  46. fi
  47.  
  48. ########################################################################
  49. # use find to add the filenames to a temp file.  if you add more file
  50. # types (e.g. .gif is a file type)
  51. # you'll probably want to update /cgi-bin/newwais.pl in your httpd
  52. # httpd directory so the search result is pretty
  53.  
  54. for dir in $DIRECTORIES
  55. do
  56.    find $DOCROOT/$dir -follow -name "*.html" -print >> $INDEX_NAME.idxable ;
  57. done
  58.  
  59.  
  60. ########################################################################
  61. # index the files using the temp file as input.  The URL substitution
  62. # is a feature of freeWAIS .202 and up.  it transforms the filename
  63. # into the correct URL so that relative URL's work.  The general
  64. # form is -t URL <what to strip off the front> <what to add to the front>
  65. #
  66. # notes:
  67. #
  68. # * use -a on the subsequent index runs to keep appending to the index file
  69. # * -nocontents tells the indexer to only use the filename...the file
  70. #   contents is ignored
  71.  
  72. ./waisindex -d $INDEX_NAME -export -t URL $CD_MOUNT/var/opt/WWW/NCSA/htdocs  http://$HTTP_SERVER -stdin < $INDEX_NAME.idxable
  73.  
  74. ./waisindex -a -nocontents -d $INDEX_NAME -export -t URL $CD_MOUNT/var/opt/WWW/NCSA/htdocs  http://$HTTP_SERVER -stdin < $INDEX_NAME.notidxable
  75.  
  76.    
  77.